<ul class="nav nav-tabs">
	<li class="active"><a href="javascript:;">文件下载</a></li>
</ul>
<div class="clearfix">
	<div class="alert alert-danger">
		<i class="fa fa-exclamation-triangle"></i> 温馨提示：如果下载文件较多，用时较长，请耐心等待！
	</div>
	<div class="page-header jinyun-page-header">
		<h4 ng-init="pagedata.download(1)"><i class="fa fa-cloud"></i> 正在下载</h4>
	</div>
	<div class="progress" title="下载进度">
		<div class="progress-bar progress-bar-info progress-bar-striped active" id="plugin_parts" role="progressbar" aria-valuenow="{{pagedata.progress}}" aria-valuemin="0" aria-valuemax="100" style="width: {{pagedata.progress}}%;"></div>
	</div>
</div>
<script>
window.scope.pagedata.download=function(part){
	if(part<=window.scope.pagedata.parts){
		window.scope.post({},'download','part='+part,function(res){
			if(res=='success'){
				
				$('#plugin_parts').attr('aria-valuenow',part);
				part++;
				window.scope.pagedata.progress = part/window.scope.pagedata.parts*100;
				window.scope.$apply();
				window.scope.pagedata.download(part);
			}else{
				alert('下载失败！'+res);
			}
		});
	}else{
		//下载完毕
		window.scope.pagedata.progress = 100;
		if(scope.pagedata.back=='goback'){
			window.scope.goback();
		}else{
			window.scope.access_json(scope.pagedata.back);
		}
		
	}
}
</script>